import mongoose from 'mongoose';
import Kutils from '../modules/Kutils';

const kutil = new Kutils();
const TABLE_NAME = 'command_config';

function createdTime() {
    return +new Date();
}

function formatDate() {
    return kutil.dateFormat(new Date());
}

const schema = new mongoose.Schema({
    createdTime: { type: Number, default: createdTime },
    updatedTime: { type: Number, default: createdTime },
    formatDate: { type: String, default: formatDate },
    order: String,
    command: String,
}, { versionKey: false });

export const model = mongoose.model(TABLE_NAME, schema);
